import pygame.sprite

from ui.battle_line import battle_line
from utils import get_layer

if __name__ == '__main__':
    pygame.init()
    screen = pygame.display.set_mode([800, 600])

    group = pygame.sprite.LayeredUpdates()
    battle_line = battle_line()

    sp = pygame.sprite.DirtySprite()
    sp.image = pygame.surface.Surface((80, 80))
    sp.image.fill([255, 0, 0])
    sp.rect = sp.image.get_rect()
    group.add(sp, layer=get_layer("system"))

    while True:
        screen.fill([0, 0, 0])
        for event in pygame.event.get():
            if event.type == pygame.QUIT:
                exit()

        group.update()
        group.draw(screen)

        battle_line.update()
        battle_line.draw(screen)

        pygame.display.update()
